<% if @last_order.present? %>
  <div class="card mb-4">
    <div class="card-header">
      <h5 class="card-title">
        <%= Spree.t('admin.user.last_order_placed') %>
      </h5>
    </div>
    <div class="card-body p-0">
      <% cache spree_base_cache_scope.call(@last_order) do %>
        <ul class="list-group list-group-flush">
          <li class="list-group-item">
            <div class="row">
              <div class="col-lg-9">
                <p class="mb-1">
                  <%= link_to @last_order.number, spree.edit_admin_order_path(@last_order), class: 'font-weight-bold' %>
                  <%= order_payment_state(@last_order, class: 'ml-2') %>
                  <%= order_shipment_state(@last_order, class: 'ml-2') %>
                </p>
                <span class="text-muted" data-controller="tooltip">
                  <%= spree_time_ago(@last_order.completed_at) %>
                  <%= tooltip(spree_time(@last_order.completed_at)) %>
                </span>
              </div>
              <div class="col-lg-3 text-lg-right font-weight-bold">
                <%= @last_order.display_total %>
              </div>
            </div>
          </li>
          <%= render collection: @last_order_line_items, partial: 'spree/admin/users/last_order_line_item', as: :line_item, cached: spree_base_cache_scope %>
        </ul>
      <% end %>
    </div>
  </div>
<% end %>
